package cn.webrx.mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface DbMapper {
    public List<String> tbs();

    public List<String> tbs(String db);

    //@Select("show databases")
    public List<String> dbs();

    @Select("select version()")
    public String version();

    @Select("select user,host,authentication_string,plugin from mysql.user")
    public List<Map<String, Object>> userInfo();

    @Select("select database(),user(),version(),@@datadir,@@basedir")
    public Map<String, Object> dbInfo();

    @Select("show create table ${tb}")
    public Map<String, Object> showCreateTable(String tb);
}
